<form id="edit-form" class="form-horizontal form-ajax" role="form" data-toggle="validator" method="POST" action="">
	<div class="form-group">
        <label for="c-category_id" class="control-label col-xs-12 col-sm-2">{:__('Category')}:</label>
        <div class="col-xs-12 col-sm-8">
            <input id="c-category_id" class="form-control selectpage" data-source="category/selectpage" data-params='{"custom[type]":"article"}' name="row[category_id]" type="text" value="{$row.category_id|default=''}" data-rule="required">
        </div>
    </div>
	{php}
	if($method == 'add'){
	    $row['flag'] = '';
	}
	{/php}
	    <div class="form-group">
        <label for="c-flag" class="control-label col-xs-12 col-sm-2">{:__('Flag')}:</label>
        <div class="col-xs-12 col-sm-8">
            {:build_select('row[flag]', ['recommend'=>__('Recommend'), 'index'=>__('Index'), 'hot'=>__('Hot')], $row['flag'], ['id'=>'c-flag','class'=>'form-control selectpicker','data-rule'=>'required'])}
        </div>
    </div>
	
    <div class="form-group">
        <label for="c-flag" class="control-label col-xs-12 col-sm-2">{:__('Flag')}:</label>
        <div class="col-xs-12 col-sm-8">
            {if condition="$method eq 'edit'"}
			{:build_select('row[flag][]', ['h' => __('H'),'i' => __('I'),'r' => __('R')], $row.flag, ['id' => 'c-flag','required' => '','class' => 'form-control selectpicker','multiple' => ''])}
			{else /}
			{:build_select('row[flag][]', ['h' => __('H'),'i' => __('I'),'r' => __('R')], '', ['id' => 'c-flag','required' => '','class' => 'form-control selectpicker','multiple' => ''])}
			{/if}
        </div>
    </div>
    <div class="form-group">
        <label for="c-title" class="control-label col-xs-12 col-sm-2">{:__('Title')}:</label>
        <div class="col-xs-12 col-sm-8">
            <input id="c-title" required="" class="form-control" name="row[title]" type="text" value="{$row.title|default=''}">
        </div>
    </div>
    <div class="form-group">
        <label for="c-content" class="control-label col-xs-12 col-sm-2">{:__('Content')}:</label>
        <div class="col-xs-12 col-sm-9">
            <textarea id="c-content" required="" class="form-control summernote" rows="5" name="row[content]" cols="50">{$row.content|default=''}</textarea>
        </div>
    </div>
    <div class="form-group">
        <label for="c-image" class="control-label col-xs-12 col-sm-2">{:__('Image')}:</label>
        <div class="col-xs-12 col-sm-8">
            <div class="form-inline">
                <input id="c-image" required="" class="form-control" size="50" name="row[image]" type="text" value="{$row.image|default=''}">
                <span><button type="button" id="plupload-image" class="btn btn-danger plupload" data-input-id="c-image" data-mimetype="image/*" data-multiple="false" data-preview-id="p-image"><i class="fa fa-upload"></i> {:__('Upload')}</button></span>
                <span><button type="button" id="fachoose-image" class="btn btn-primary fachoose" data-input-id="c-image" data-mimetype="image/*" data-multiple="false"><i class="fa fa-list"></i> {:__('Choose')}</button></span>
                <ul class="row list-inline plupload-preview" id="p-image"></ul>
            </div>
        </div>
    </div>
	<div class="form-group">
        <label for="c-images" class="control-label col-xs-12 col-sm-2">图片高级选项:</label>
        <div class="col-xs-12 col-sm-8">
			<div class="checkbox">
			<label><input name="row[getImage]" type="checkbox"> 保存远程图片</label>　
            <label><input name="row[content_thumb]" type="checkbox" {if condition="$method eq 'add'"}checked="checked" {/if}> 提取文中图片到图片组</label>
            </div>
        </div>
    </div>
	<div class="form-group">
        <label for="c-images" class="control-label col-xs-12 col-sm-2">{:__('Images')}（最多3个）:</label>
        <div class="col-xs-12 col-sm-8">
            <!--<textarea id="c-images" required="" class="form-control " rows="5" name="row[images]" cols="50">{$row.images|default=''}</textarea>-->
			<input id="c-images" required="" class="form-control" size="50" name="row[images]" type="text" value="{$row.images|default=''}">
			<span><button type="button" id="plupload-images" class="btn btn-danger plupload" data-input-id="c-images" data-mimetype="image/*" data-multiple="true" data-preview-id="p-images"><i class="fa fa-upload"></i> {:__('Upload')}</button></span>
            <span><button type="button" id="fachoose-images" class="btn btn-primary fachoose" data-input-id="c-images" data-mimetype="image/*" data-multiple="true"><i class="fa fa-list"></i> {:__('Choose')}</button></span>
            <ul class="row list-inline plupload-preview" id="p-images"></ul>
        </div>
    </div>
    <div class="form-group">
        <label for="c-keywords" class="control-label col-xs-12 col-sm-2">{:__('Keywords')}:</label>
        <div class="col-xs-12 col-sm-8">
            <textarea id="c-keywords" required="" class="form-control " rows="5" name="row[keywords]" cols="50">{$row.keywords|default=''}</textarea>
        </div>
    </div>
    <div class="form-group">
        <label for="c-description" class="control-label col-xs-12 col-sm-2">{:__('Description')}:</label>
        <div class="col-xs-12 col-sm-8">
            <textarea id="c-description" required="" class="form-control " rows="5" name="row[description]" cols="50">{$row.description|default=''}</textarea>
        </div>
    </div>
    <div class="form-group">
        <label for="c-author" class="control-label col-xs-12 col-sm-2">{:__('Author')}:</label>
        <div class="col-xs-12 col-sm-8">
            <input id="c-author" required="" class="form-control" name="row[author]" type="text" value="{$row.author|default=$admin.nickname}">
        </div>
    </div>
    <div class="form-group">
        <label for="c-views" class="control-label col-xs-12 col-sm-2">{:__('Views')}:</label>
        <div class="col-xs-12 col-sm-8">
            <input id="c-views" class="form-control" name="row[views]" type="number" value="{$row.views|default=''}">
        </div>
    </div>
    <div class="form-group">
        <label for="c-comments" class="control-label col-xs-12 col-sm-2">{:__('Comments')}:</label>
        <div class="col-xs-12 col-sm-8">
            <input id="c-comments" class="form-control" name="row[comments]" type="number" value="{$row.comments|default=''}">
        </div>
    </div>
    <div class="form-group">
        <label for="c-weigh" class="control-label col-xs-12 col-sm-2">{:__('Weigh')}:</label>
        <div class="col-xs-12 col-sm-8">
            <input id="c-weigh" class="form-control" name="row[weigh]" type="number" value="{$row.weigh|default=''}">
        </div>
    </div>
    <div class="form-group">
        <label for="c-status" class="control-label col-xs-12 col-sm-2">{:__('Status')}:</label>
        <div class="col-xs-12 col-sm-8">
            {if condition="$method eq 'edit'"}
			{:build_radios('row[status]', ['normal' => __('Normal'),'hidden' => __('Hidden')], $row.status)}
			{else /}
			{:build_radios('row[status]', ['normal' => __('Normal'),'hidden' => __('Hidden')], 'normal')}
			{/if}
        </div>
    </div>
    <div class="form-group hide layer-footer">
        <label class="control-label col-xs-12 col-sm-2"></label>
        <div class="col-xs-12 col-sm-8">
            <button type="submit" class="btn btn-success btn-embossed">{:__('OK')}</button>
            <button type="reset" class="btn btn-default btn-embossed">{:__('Reset')}</button>
        </div>
    </div>
</form>
